Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added __contains__ to stl bindings for maps #1767

Merged
merged 2 commits into from
Jun 10, 2019

Conversation

flippmoke
Copy link
Contributor

Currently there is no __contains__ method defined for STL container bindings. If you do not define a __contains__ it will by default fall back to __iter__ for checking if the key exists as described here. For many C++ map containers types this can be very expensive.

@wjakob
Copy link
Member

wjakob commented Jun 10, 2019

LGTM!

@wjakob wjakob merged commit 30c0352 into pybind:master Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants